<template>
  <swiper :options="swiperOption" class="wrapper">
    <swiper-slide class="swiper-item" v-for="item of sliderList" :key="item.id">
      <a :href="item.linkUrl">
        <img class="swiper-img" :src="item.picUrl">
      </a>
      </swiper-slide>
    <div class="swiper-pagination"  slot="pagination"></div>
  </swiper>
</template>

<script>
export default {
  name: 'RecSwiper',
  props: {
    sliderList: Array
  },
  data () {
    return {
      swiperOption: {
        pagination: '.swiper-pagination',
        loop: true,
        autoplay: 4000,
        initialSlide: 1,
        observer: true,
        observeParents: true
      }
    }
  }
}
</script>

<style lang="stylus" scoped>
  .wrapper >>> .swiper-pagination-bullet
    background #fff
  .wrapper >>> .swiper-pagination-bullet-active
    width 20px
    background #fff
    border-radius 5px
  .swiper-item
    overflow hidden
    height 0
    padding-bottom 40%
    .swiper-img
      width 100%
</style>
